<#import "../tpl/pageTep.ftl" as page>
<@page.pageBase currentMenu="审批活动">
<style>
    .time {
        display: inline-block;
        height: 20px;
        line-height: 20px;
        padding: 4px 12px;
        border: 1px solid #cccccc;
        border-radius: 4px;
        vertical-align: middle;
    }

    /***循环的表单设置***/
    .bui-select .bui-select-input {
        width: 350px;
    }
</style>
<div class="xm-offline">
    <div class="row">
        <div class="panel">
            <div class="panel-header">
                <a href="${basepath}/manage/offline/toCheckList">返回上一级</a>
            </div>
            <div class="panel-body">
                <form id="detailsForm" class="form-horizontal" action=""
                      method="post">
                    <input type="hidden" class="control-text span-width span10" name="id" value="${e.id!}">

                    <div class="control-group">
                        <label class="control-label">
                            <s>*</s>
                            活动名称：
                        </label>

                        <div class="controls">
                            <input type="text" class="control-text span-width span10" name="name" value="${e.name!}"
                                   disabled="disabled">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            <s>*</s>
                            机构名称：
                        </label>

                        <div class="controls">
                            <input type="text" class="control-text span-width span10" name="organizeName"
                                   value="${e.organizeName!}" disabled="disabled">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            <s>*</s>
                            负责人：
                        </label>

                        <div class="controls">
                            <input type="text" class="control-text span-width span10" name="principal"
                                   value="${e.principal!}" disabled="disabled">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            <s>*</s>
                            联系电话：
                        </label>

                        <div class="controls">
                            <input type="text" class="tel control-text span-width span10" name="principalPhone"
                                   value="${e.principalPhone!}" disabled="disabled">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            <s>*</s>
                            所在地区：
                        </label>

                        <div class="controls">
                            <input type="text" class="control-text span-width span2" name="province"
                                   value="${e.province!}" disabled="disabled"/>&nbsp;&nbsp;
                            <input type="text" class="control-text span-width span2" name="city" value="${e.city!}"
                                   disabled="disabled"/>&nbsp;&nbsp;
                            <input type="text" class="control-text span-width span2" name="area" value="${e.area!}"
                                   disabled="disabled"/>&nbsp;&nbsp;
                            <input type="text" class="control-text span-width span10" name="address"
                                   value="${e.address!}" disabled="disabled"/>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            <s>*</s>
                            开始日期：
                        </label>

                        <div class="controls">
                            <input type="text" class="calendar" name="beginTime"
                                   value="${e.beginTime!}" disabled="disabled">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            <s>*</s>
                            结束日期：
                        </label>

                        <div class="controls">
                            <input type="text" class="calendar" name="endTime"
                                   value="${e.endTime!}" disabled="disabled">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            <s>*</s>
                            活动时段：
                        </label>

                        <div class="controls">
                            <input type="text" name="beginTimeFrame"  value="${e.beginTimeFrame!}" disabled="disabled"><label>
                              &nbsp;-&nbsp;</label>
                              <input type="text" name="endTimeFrame"  class="time" value="${e.endTimeFrame!}" disabled="disabled">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            周期循环：
                        </label>

                        <div class="controls " id="s1">
                            <input type="hidden" id="hide" name="circulation" value="${e.circulation!}"
                                   disabled="disabled">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            <s>*</s>
                            活动类型：</label>

                        <div class="controls">
                            <input type="text" class="control-text" name="type" value=""
                                   disabled="disabled" id="type"/>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            <s>*</s>
                            参与人员：
                        </label>

                        <div class="controls">
                            <input type="text" class="control-text" name="participant" value=""
                                   disabled="disabled" id="participant"/>
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label">

                            报名条件：
                        </label>

                        <div class="controls">
                            <input type="text" class="control-text span-width span10" name="conditions"
                                   value="${e.conditions!}" disabled="disabled"/>
                        </div>
                    </div>
                    <div class="control-group" id="offline-limits">
                        <label class="control-label">
                            参与人数：
                        </label>

                        <div class="controls">

                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            报名人数：
                        </label>

                        <div class="controls">
                            <input type="text" class="control-text span-width span10" name="accountNum"
                                   value="${e.accountNum!}"
                                   disabled="disabled"/>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            <s>*</s>
                            活动介绍：
                        </label>

                        <div class="controls control-row12" style="height: 350px;initialFrameWidth: 100%;">
                            <textarea type="text" class="input-large" name="content"
                                      id="content" disabled="disabled">${e.content!}</textarea>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            <s>*</s>
                            推送资讯栏：</label>

                        <div class="controls">
                            <input type="text" class="control-text" name="send" value=""
                                   disabled="disabled" id="send"/>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            <s>*</s>
                            审批结果：</label>

                        <div class="controls">
                            <input type="text" class="control-text span-width span6" name="status" value=""
                                   disabled="disabled" id="status"/>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>


<script type="text/javascript">
    //ueditor编辑器不可编辑状态
    var editor = UE.getEditor('content', {
        readonly: true
    });
    var Grid = BUI.Grid;
    var Store = BUI.Data.Store;
    var imagesStore = new Store({});
    var editForm = new BUI.Form.Form({
        srcNode: '#detailsForm',
        submitType: 'ajax',
        callback: function (data) {
            if (data.success == true) {
                window.location.href = "${basepath}/manage/offline/toList"
            } else {

            }
        }
    }).render();
    //对审核结果的状态做判断塞值到input中
    var status = "${e.status!}";
    if (status == "4") {
        $("#status").val("待审核");
    }
    if (status == "1" || status == "2" || status == "3") {
        $("#status").val("已通过");
    }
    if (status == "5") {
        $("#status").val("超时");
    }
    if (status == "") {
        $("#status").val("不通过");
    }
    //对活动类型做判断塞值到input中
    var type = "${e.type!}";
    var type = "${e.type!}";
    if (type == "1") {
        $("#type").val("志愿活动");
    } else {
        $("#type").val("募捐活动");
    }
    //对参与对象做判断塞值到input中
    var participant = "${e.participant!}";
    if (participant == "1") {
        $("#participant").val("所有志愿者");
    } else if (participant == "2") {
        $("#participant").val("仅限内部志愿者");
    } else {
        $("#participant").val("仅限外部志愿者");
    }
    //对是否推送到资讯栏做判断塞值到input中
    var send = "${e.send!}";
    if (send == "y") {
        $("#send").val("是");
    } else {
        $("#send").val("否");
    }
    //参与人数
    var limits = "${e.limits!}";
    var limitsHtml = "";
    if (limits == "0") {
        limitsHtml = '<input type="text" class="control-text span-width span10" name="limits " value="不限" disabled="disabled" />';

    } else {
        limitsHtml = '<input type="text" class="control-text span-width span10" name="limits " value="' + limits + '" disabled="disabled" />';
    }
    document.getElementById("offline-limits").innerHTML += limitsHtml;
    /*--------------------------循环的选项  begin--------------------*/
    BUI.use('bui/select', function (Select) {

        var items = [
                    {text: '周一', value: '周一'},
                    {text: '周二', value: '周二'},
                    {text: '周三', value: '周三'},
                    {text: '周四', value: '周四'},
                    {text: '周五', value: '周五'},
                    {text: '周六', value: '周六'},
                    {text: '周日', value: '周日'}
                ],
                select = new Select.Select({
                    render: '#s1',
                    valueField: '#hide',
                    multipleSelect: true,
                    disabled: true,
                    items: items
                });
        select.render();
    });
    /*--------------------------循环的选项  end--------------------*/
</script>

</@page.pageBase>